package com.education.controller.showStudyOnline;

import com.education.pojo.ExampleQuestions;
import com.education.service.impl.SelectTestPeperImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * Created by Administrator on 2018/4/27.
 * 根据试卷ID获取对应的题
 */
@Controller
@CrossOrigin(origins = "*",maxAge = 3600)
public class SelectExampleQuestionById {
    @Autowired
    private SelectTestPeperImpl selectTestPeper;



    @RequestMapping("/selectAllExampleQuestionById")
    @ResponseBody
    public List<ExampleQuestions> selectAllExampleQuestionById(HttpServletRequest req){
        int tpId = Integer.parseInt(req.getParameter("tpId"));
        List<ExampleQuestions> list = selectTestPeper.getAllExampleQustionByID(tpId);
        return list;
    }
}
